package com.water.camera.util;

import android.content.Context;
import android.util.Log;

import androidx.annotation.NonNull;

import com.bumptech.glide.GlideBuilder;
import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.load.engine.cache.MemorySizeCalculator;
import com.bumptech.glide.module.AppGlideModule;

@GlideModule
public class CustomGlideModule extends AppGlideModule {

    @Override
    public void applyOptions(@NonNull Context context, @NonNull GlideBuilder builder) {
        // Default empty impl.
        Log.e("tagg", "here here here");
        MemorySizeCalculator memorySizeCalculator = new MemorySizeCalculator.Builder(context).build();
        builder.setMemoryCache(new MyLruResourceCache(memorySizeCalculator.getMemoryCacheSize()));
    }

    @Override
    public boolean isManifestParsingEnabled() {
        return false;
    }
}
